import React from "react";

const FontAwesome = (props) => {
    
    const handleClick = () => {
        // 调用API，往编辑器中插入一个数字
        props.editor.insertText(
            ":fa-heart:\n\n" +
            "<p>向量图标（Font Awesome）代码例如: \"cloud\", \"flag\", \"car\", \"truck\", \"heart\", \"dollar\" ...</p>\n" +
            "<p>完整列表请参考 <a href=\"http://fontawesome.io/icons/\" target=\"_blank\">Font Awesome 图标</a>。</p>\n"
        );
    }

    return (
        <span
        className="button button-type-counter"
        title="向量图标(Font awesome)"
        onClick={handleClick}
        >
        <i className="fa fa-flag" />
        </span>
    );
}

FontAwesome.align = 'left';
FontAwesome.pluginName = 'fontawesome';

export default FontAwesome;